<html>
<head><meta charset="utf-8"><title>fn_sig_for_fn_abi() in rustc_middle::ty::Instance · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/fn_sig_for_fn_abi().20in.20rustc_middle.3A.3Aty.3A.3AInstance.html">fn_sig_for_fn_abi() in rustc_middle::ty::Instance</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210713058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/fn_sig_for_fn_abi%28%29%20in%20rustc_middle%3A%3Aty%3A%3AInstance/near/210713058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> sfzhu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/fn_sig_for_fn_abi().20in.20rustc_middle.3A.3Aty.3A.3AInstance.html#210713058">(Sep 21 2020 at 08:28)</a>:</h4>
<p>I didn't understand how the var <code>sig</code> turns out to be <code>ty::PolyFnSig</code>. First, I couldn't find a function matching the signature of <code>tcx.fn_sig(def_id)</code>. Second, I didn't know <code>normalize_erasing_regions</code> and <code>subst</code> were implemented for <code>ty::PolyFnSig</code> --- I didn't find it related with <code>TypeFoldable</code> trait... <span aria-label="dizzy" class="emoji emoji-1f635" role="img" title="dizzy">:dizzy:</span></p>
<p>Source code: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/layout.rs.html#2328">https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/layout.rs.html#2328</a></p>



<a name="210824673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/fn_sig_for_fn_abi%28%29%20in%20rustc_middle%3A%3Aty%3A%3AInstance/near/210824673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> sfzhu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/fn_sig_for_fn_abi().20in.20rustc_middle.3A.3Aty.3A.3AInstance.html#210824673">(Sep 22 2020 at 03:20)</a>:</h4>
<p>update: I have just understood it --- <code>ty::PolyFnSig</code> would be auto-derefed as <code>FnSig</code>, which answers my second question. But still confused about which fn_sig was called here.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>